package handlers;

import java.util.List;

import domainlogic.ai.MovementAi;

import other.Life;
import other.World;

public class AiHandler {

	private static byte lastRun = 0;
	private static int updatesPerSecond = 1000/20;
	
	public static void update(int delta){
		lastRun += delta;
		if(lastRun>updatesPerSecond){
			lastRun -= updatesPerSecond;
			List<Life> lives = World.getLives();
			for (int i = 0; i < lives.size(); i++) {
				MovementAi.update(lives.get(i));
			}
		}
	}
	
}
